<%@ page import="auctionatr.Auction"%>
<html>
<head>
<title><g:message code="portal.index.willkommen.label" /></title>
<meta name="layout" content="main" />

<jq:plugin name="flip" />

<script type="text/javascript"
	src="${resource(dir:'js', file:'tiles.js') }"></script>
<link rel="stylesheet" class="cssfx"
	href="${resource(dir:'css', file:'tile.css') }" />
</head>

<body>
	<g:if test="${flash.message}">
		<div class="message">
			${flash.message}
		</div>
	</g:if>

	<div class="body">
		<div id="tiles">
			<div class="tile" class="first">
				<div class="tileContent">
					<div class="tileText tile1"></div>
				</div>
			</div>
			<div class="tile">
				<div class="tileContent">
					<div class="tileText tile2"></div>
				</div>
			</div>
			<div class="tile">
				<div class="tileContent">
					<div class="tileText tile3"></div>
				</div>
			</div>
			<div class="tile">
				<div class="tileContent">
					<div class="tileText tile4"></div>
				</div>
			</div>

			<div class="tile" class="first">
				<div class="tileContent">
					<div class="tileText tile5"></div>
				</div>
			</div>
			<div class="tile">
				<div class="tileContent">
					<div class="tileText tile6"></div>
				</div>
			</div>
			<div class="tile">
				<div class="tileContent">
					<div class="tileText tile7"></div>
				</div>
			</div>
			<div class="tile">
				<div class="tileContent">
					<div class="tileText tile8"></div>
				</div>
			</div>
		</div>
		<div id="tileStorage">
			<g:each in="${data}" status="i" var="auctionInstance">
				<div id="tileData" class="${i+1}">
					<div id="tileTitle${i+1}">
						<g:link action="show" id="${auctionInstance.id}">
							${fieldValue(bean: auctionInstance, field: "name")}
						</g:link>
					</div>

					<div id="tileDescription${i+1}">
						<g:link action="show" id="${auctionInstance.id }">
							${fieldValue(bean : auctionInstance, field : "description") }
						</g:link>
					</div>

					<div id="tilePrice${i+1}">
						<g:link action="show" id="${auctionInstance.id}">
							<g:formatNumber number="${bids[i]}" type="currency"
								currencyCode="EUR" />
						</g:link>
					</div>


					<div id="tilePic${i+1}">
						<g:if test="${data[i].picture}">
							<img class="auctionImage" width="150"
								src="${createLink(
									controller:'auction',
									action:'auctionImage',
									id:fieldValue(
									bean: auctionInstance, field: "id"))}" />
						</g:if>
						<g:else>
							<g:link action="show" id="${auctionInstance.id}">
								<img class="auctionImage" width="150"
									src="%3D%3D" />
							</g:link>
						</g:else>
					</div>
				</div>
			</g:each>
		</div>
</body>
</html>